package com.ncmmall.domain.business.marketing.shoppingcard;

import com.ncmmall.domain.business.order.Order;
import com.ncmmall.domain.business.order.OrderDetail;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * 用户购物卡消费记录
 *
 * @author likaikai
 * @date 2020-01-17 20:44:23
 */
@Entity
@Table(name = "mall_shopping_card_record_consume")
@Access(AccessType.FIELD)
@Getter
@Setter
public class ShoppingCardRecordConsume {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 购物卡
     */
    @OneToOne
    private ShoppingCardRecord shoppingCardRecord;

    /**
     * 消费的订单
     */
    @OneToOne
    private Order order;

    @OneToOne
    private OrderDetail orderDetail;

    /**
     * 本次订单使用的购物卡金额
     */
    private double price;

    /**
     * 本次消费后购物卡的余额
     */
    private double balance;

    /**
     * 创建时间
     */
    private Timestamp createTime;

}
